﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;
using QlyKinhDoanh.Utility;

namespace prjQlyKinhDoanh
{
    public partial class frmReportThietBiPCCC : Form
    {
        public frmReportThietBiPCCC()
        {
            InitializeComponent();
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void frmReportThietBiPCCC_Load(object sender, EventArgs e)
        {
            SqlParameter[] para = new SqlParameter[1];
            para[0] = new SqlParameter("@iDiaBanChaID", SqlDbType.Int);
            para[0].Value = System.Configuration.ConfigurationSettings.AppSettings.Get("CurrentRegion");

            mtbTuNgay.Text = Common.GetCurrentDate();
            mtbDenNgay.Text = Common.GetCurrentDate();
            DB_Utility.List_LoadData(cboDiaBan, "DMDiaBan_SelectByMaCha", para, "ID", "TenDiaBan", "[Tất cả]", 0);
        }

        private void btnXemBaoCao_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            ListItem selectedItem = new ListItem();
            selectedItem = (ListItem)cboDiaBan.SelectedItem;
            frmThietBiPCCCViewer frm = new frmThietBiPCCCViewer(mtbTuNgay.Text, mtbDenNgay.Text, Common.IntValue(selectedItem.ItemData.ToString()));
            frm.ShowDialog();
            this.Cursor = Cursors.Default;
        }

    }
}